package aqua.smile.springboot.srvapi.jackson;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@RequestMapping("/json")
@RestController
public class JacksonController {

    @GetMapping("/resp")
    public JsonEntity resp() {
        JsonEntity jsonEntity = new JsonEntity()
                .setId(1001L)
                .setSex(1)
                .setAddr("盘龙区")
                .setMoney(new BigDecimal("10321.12"))
                .setBirthday(LocalDateTime.now().toLocalDate())
                .setCreTime(LocalDateTime.now())
                .setLocalTime(LocalDateTime.now().toLocalTime());
        return jsonEntity;
    }

}
